import http from '@/utils/http'
export const getCateListApi = async (data) => {
  const url = '/api/catelist'
  return http.get(url,{ params :{ istree:data}})
}

export const addCateApi = async (data) => {
  const url = '/api/cateadd'
  return http.post(url,data)
}

export const getCateApi = async (data) => {
  const url = '/api/cateinfo'
  return http.get(url,{params:{id:data}})
}

export const setCategoryApi = async (data) => {
  const url = '/api/cateedit'
  return http.post(url,data)
}

export const delCategoryApi = async (data) => {
  const url = '/api/catedelete'
  return http.post(url,{ id: data })
}

export const getListApi = async () => {
  const url = '/api/catelist'
  return http.get(url)
}